home *** CD-ROM | disk | FTP | other *** search
- /*rx
- * Lookup.rexx --- program to lookup a regular expression using the
- * ISpell server from CLI.
- *
- * Copyright © 1990, 1992 Loren J. Rittle
- * Use as you will, just document your changes and keep my copyright
- * notice intact. Feel free to mail enhancements to me.
- *
- * Loren J. Rittle
- * rittle@comm.mot.com
- * Sun Sep 27 11:30:46 1992
- */
-
- options results
-
- if left(address(), 4) ~== 'WSH_' then
- address command
-
- if words(arg(1)) = 0 then
- do
- say "Usage: lookup word1 word2 ..."
- exit 5
- end
-
- if ~show(ports, 'IRexxSpell') then
- do
- 'run <nil: >nil: ispell -r >nil: <nil:'
- waitforport 'IRexxSpell'
- end
-
- do i = 1 to words(arg(1))
- item = word(arg(1),i)
- address 'IRexxSpell' lookup item
- r = result
- r1 = substr(r,1,1)
- select
- when r1 = '&' then
- say "The pattern '"||item||"' matches:" translate(substr(r,3), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- otherwise say "For the pattern '"||item||"' I got" r
- end
- end
-
- exit 0
-